<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="css/findpassword.css" />
	</head>

	<body>
		<div style="width:500px;margin:160px auto;">
			<p style="margin-bottom: 15px;color: #ffffff;font-size: 14px;text-shadow:1px 1px 0 rgba(66,26,13,.3);">
				<span style="cursor: pointer;" onclick="window.location.href='home.html'">返回圣嘉尔网站首页</span>
				<span style="margin-left: 209px;">还没有帐号？</span>
				<a href="register.html" style="color:#ffffff;border: 1px solid #ffffff;padding:7px;border-radius: 2px;text-decoration: none;">马上注册</a>
			</p>
			<div class="loginbox">
				<img src="img/logo1.png" />
				<p style="margin-bottom: 24px">
					<span class="line1">————————</span>
					<span style="font-size: 16px;color: #69452c;margin: 0 13px;">高端海外产子品牌</span>
					<span class="line1">————————</span>
				</p>
				<p>
					<span style="font-size: 20px;color: #312f2f;">重置密码</span>
					<span style="margin-left: 145px;font-size: 14px;color: #8a8a8a;">通过短信验证的方式，更换新密码</span>
				</p>
				<form class="cmxform" id="signupForm" method="post" action="/baby/retPwd/upUserPwd">
					<p class="input-box">
						<span class="input-left">
							<input type="tel" name="phonNum" id="phonNum" placeholder="请输入手机号"/>
							<span id="puchCode" onclick="findPushCode()">发送验证码</span>
						</span>
					</p>
					<p class="input-box">
						<span class="input-left">
							<input type="number" name="checkNum"  id="checkNum" placeholder="请输入6位数字短信验证码"/>
						</span>
					</p>
					<p class="input-box">
						<span class="input-left">
							<input type="password"  name="password" id="password" placeholder="请输入密码"/>
						</span>
					</p>
					<p class="input-box">
						<span class="input-left">
							<input type="password" name="pwd" id="pwd" placeholder="请确认新密码"/>
						</span>
					</p>
					<!--<a id="submit" class="registerbtn">提交</a>-->
					<input type="submit" id="submit" class="registerbtn" value="提交" />
				</form>
			</div>
			<p class="copyright">苏ICP备15000743号© 2015 圣嘉尔版权所有</p>
		</div>
		<script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
		<script type="text/javascript" src="js/cookieUtil.js"></script>
		<script type="text/javascript" src="js/register.js"></script>
		<script type="text/javascript" src="js/toolUtil.js"></script>
		<script type="text/javascript" src="js/jquery.validate.min.js" ></script>
		<script type="text/javascript" src="js/messages_zh.min.js" ></script>
		<script type="text/javascript" src="js/jquery-form.js" ></script>
		<script type="text/javascript">
//			$(document).ready(function() {
//				$("#puchCode").click(function() {
//					findPushCode();
//				});
//				$("#submit").click(function() {
//					findPwd();
//
//				});
//			});
			$().ready(function() {
	 			
				
				// 在键盘按下并释放及提交后验证提交表单
				$("#signupForm").validate({
					rules: {
						checkNum: {
							required: true,
							minlength: 6,
							maxlength: 6
						},
						password: {
							required: true,
							minlength: 6,
							maxlength: 18
						},
						pwd: {
							required: true,
							minlength: 6,
							maxlength: 18,
							equalTo: "#password"
						}
					},
					messages: {
						checkNum: {
							required: "请输入验证码",
							minlength: "验证码长度6位",
							maxlength: "验证码长度6位"
						},
						password: {
							required: "请输入密码",
							minlength: "密码长度不少于6位",
							maxlength: "密码长度不多于18位"
						},
						pwd: {
							required: "请输入密码",
							minlength: "密码长度不少于6位",
							maxlength: "密码长度不多于18位",
							equalTo: "两次密码输入不一致"
						}
					}
				});

				//绑定form

				$('#signupForm').ajaxForm(function(data) {
					//弹出ajax请求后的回调结果，data回调数据  onclick="sub()"
					console.log(data)
					if(data.code == "2000") {
						alert(data.message);
						//setCookie("username",data.data.userName);
						window.location.href = "login.html"
							// window.location.reload();   
					} else {
						alert(data.message);
					}
				}); 
				

			})
		</script>
	</body>
</html>